package com.jr.controller;

import com.jr.entity.Resume;
import com.jr.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class ResumeController {
    @Autowired
    private ResumeService resumeService;

    /**\
     * 点击个人登录，跳转登录页面
     * @return
     */
/*    @RequestMapping("/login")
    public String login(){
        return "login.html";
    }*/
    /**
     * 点击一分钟简历按钮，跳转至resume.html页面
     */
  /*  @RequestMapping("/onemin")
    public String oneminute(){
        return "resume.html";
    }*/

    @RequestMapping("/onemin")
    public ModelAndView onemin(String uid) {
        ModelAndView mv = new ModelAndView();
        mv.addObject("uid", uid);
        mv.setViewName("resume");
        return mv;


    }

    /**
     * 点击返回首页事件
     * @return
     */
    @RequestMapping("/returnfirstpage")
    public String rtfirstpage(){
        return "index.html";
    }

    /**
     * 一分钟登录的添加方法

     */
    @RequestMapping("/oneminresume")
    public ModelAndView oneminresume(Resume resume){
        ModelAndView mv=new ModelAndView();
        resumeService.addOneMinuteResume(resume);
        mv.setViewName("index.html");
        return mv;

    }
}